import store from "../../redux";

function Home() {
  console.log(store.getState());
  const { count } = store.getState();
  const incNumber = () => {
    // console.log("incNumber");
    const addCount = { type: "incNumber", data: 2 };
    store.dispatch(addCount);
    console.log(store.getState(), "store.getState()");
  };
  const updateName = () => {
    const name = { type: "updateName" };
    store.dispatch(name);
    console.log(store.getState(), "name");
  };
  return (
    <div>
      首页 {count}
      <button onClick={incNumber}>数据+2</button>
      <button onClick={updateName}>修改name</button>
    </div>
  );
}

export default Home;
